﻿//选择一级分类后的联动效果
function firstarry(id) {
        YXShop.Web.Admin.Product.Product.secondClass(id, firstClass);
}
//选择二级分类后的联动效果
function Secondarry(id) {
        YXShop.Web.Admin.Product.Product.thirdClass(id, secondClass);
}
//选择三级分类后的联动效果
function thirdarry(id) {
        YXShop.Web.Admin.Product.Product.fourClass(id, thirdClass);
}

//选择一级分类后，填充二级分类
function firstClass(res) {
    document.getElementById("secondClass").innerHTML = res.value;
    document.getElementById("thirdClass").innerHTML = "<select size='18' style='width: 180px'></select>";
    document.getElementById("fourClass").innerHTML = "<select size='18' style='width: 180px'></select>";
}
//选择二级分类后，填充三级分类
function secondClass(res) {
    document.getElementById("thirdClass").innerHTML = res.value;
    document.getElementById("fourClass").innerHTML = "<select size='18' style='width: 180px'></select>";
}
//选择三级分类后，填充四级及以下分类
function thirdClass(res) {
    document.getElementById("fourClass").innerHTML = res.value;
}
function OptionValue(ClassID) {
    document.getElementById("txtPro_CID").value = ClassID; //使用隐藏域记录下商品分类ID，以便商品添加时取值
    var content = YXShop.Web.Admin.Product.Product.Vali(ClassID);
    if (content.value == false) {
        document.getElementById("Button1").disabled = false;
    }
    else {
        document.getElementById("Button1").disabled = true;
    }
}


//选择省联动效果
function OCprovince(id) {
    YXShop.Web.Admin.Product.Product.City(0, id, backprovince);
}
//选择市后的联动效果
function OCcity(id) {
    YXShop.Web.Admin.Product.Product.Borough(0, id, backcity);
}
//选择区后的联动效果
function OCborough(id) {
    YXShop.Web.Admin.Product.Product.Calm(0, id, backborough);
}

//选择省后，填充二级分类
function backprovince(res) {
    document.getElementById("City").innerHTML = res.value;
    document.getElementById("Borough").innerHTML = "<select size='12' style='width: 180px'></select>";
    document.getElementById("Calm").innerHTML = "<select size='12' style='width: 180px'></select>";
}
//选择市后，填充三级分类
function backcity(res) {
    document.getElementById("Borough").innerHTML = res.value;
    document.getElementById("Calm").innerHTML = "<select size='12' style='width: 180px'></select>";
}
//选择区后，填充四级及以下分类
function backborough(res) {
    document.getElementById("Calm").innerHTML = res.value;
}
function OptionProvinceValue(ClassID) {
    document.getElementById("Province_ID").value = ClassID; //使用隐藏域记录下商品分类ID，以便商品添加时取值
    var content = YXShop.Web.Admin.Product.Product.ValiProvince(ClassID)
    var contentProClass = YXShop.Web.Admin.Product.Product.Vali(document.getElementById("txtPro_CID").value)
    if (content.value == false && contentProClass.value == false && document.getElementById("txtPro_CID").value != "") {
        document.getElementById("Button1").disabled = false;
    }
    else {
        document.getElementById("Button1").disabled = true;
    }

}